﻿using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms.Design;

namespace HML.Design
{
    /// <summary>
    /// VGradualPercentage控件设计模式行为
    /// </summary>
    public class VGradualPercentageDesigner : ControlDesigner
    {
        public override void InitializeNewComponent(IDictionary defaultValues)
        {
            base.InitializeNewComponent(defaultValues);

            VGradualPercentage gradualPercentage = (VGradualPercentage)this.Component;
            MemberDescriptor member = (MemberDescriptor)TypeDescriptor.GetProperties((object)this.Component)["GradualColors"];
            this.RaiseComponentChanging(member);
            gradualPercentage.GradualColors.Add(new GradualPercentageColor() { Color = Color.YellowGreen, Position = 0 });
            gradualPercentage.GradualColors.Add(new GradualPercentageColor() { Color = Color.Tomato, Position = 1 });
            this.RaiseComponentChanged(member, (object)null, (object)null);

        }

    }

}
